for i in range(1,10):
    for j in range(1,i+1):
        print("{}*{}={:<5}".format(i,j,i*j),end="")
    print('')
print("直角左下")
print("="*150)
for i in range(9,0,-1):
    for j in range(1,i+1):
        print("{}*{}={:<5}".format(i,j,i*j),end="")
    print('')
print('直角左上')
print("="*150)
for i in range(1,10):
    for j in range(9,0,-1):
        if j>i:
            print("        ",end='')
        else:
            print("{}*{}={:<4}".format(i, j, i * j), end='')
    print('')
print("直角右下")
print('='*150)
for i in range(1,10):
    for j in range(1,10):
        if j<i:
            print("        ",end='')
        else:
            print("{}*{}={:<4}".format(i, j, i * j), end='')
    print('')
print("")
print("直角右上")
print('='*150)